obj = require('./compile_sol.js')

//部署
account = '0xd6cc4024572ca10bffbb0d1802e1991608ad665f';
account2 = '0x9d737861c9f26680820d7584ab69975280d27d3a';
Web3 = require('web3');
web3 = new Web3();
web3.setProvider('http://localhost:8546');

var gasInfo = {from: account2, gas: 1500000, gasPrice: '1'};

myContract = new web3.eth.Contract(obj.abi, '0x5a97A6E58219e00eBc4E215ED7a352731Cd6d31b');
myContract.methods.getWinner().call(function (err, res) {
    console.log("res: ", res);
});

//myContract.methods.vote(2)
//    .send(gasInfo, function (err, res) {
//        console.log("res: ", res);
//    });

//myContract.methods.authorize('0x9d737861c9f26680820d7584ab69975280d27d3a')
//    .send(gasInfo, function (err, res) {
//        console.log("res: ", res);
//  });



